﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ViewRidgeAssistant
{
    public partial class sql_console : Form
    {

        private data_source _data_module;

        public sql_console()
        {
            InitializeComponent();
        }

        public sql_console(data_source data_module)
        {
            InitializeComponent();
            this._data_module = data_module;
        }

        private void b_execute_Click(object sender, EventArgs e)
        {
            DataTable dt = null;
            dt = this._data_module.get_table_by_user_query(this.tb_sql_query.Text);
            if (dt != null)
            {
                this.gw.DataSource = dt.DefaultView;
            }
        }

    }
}
